# coding=utf-8

# 配置文件
import configparser
import inspect
import os
import sys
import io

config = configparser.ConfigParser()
dirPath = os.path.dirname(inspect.currentframe().f_code.co_filename)
cfgfile = dirPath + "/config.ini"

# config.read(cfgfile)

with io.open(cfgfile, 'r', encoding='utf_8_sig') as fp:
    config.readfp(fp)

#
BASE_PYTHON_COMMAND = config.get("BASE", "PYTHON_COMMAND")
DB_PREFIX = config.get("DB", "PREFIX")
BASE_IMAGE_DIR = config.get("BASE", "IMAGE_DIR")
# BASE_EMAIL = config.get('BASE', 'EMAIL')
# BASE_BANK_CARD_INFO_URL = config.get('BASE', 'BANK_CARD_INFO_URL')

# 消息队列消息间隔时间
# GET_ORDER_INTERVAL = int(config.get('BASE', 'GET_ORDER_INTERVAL'))

# 消息队列地址
# QUEUE_HOST = str(config.get("QUEUE", "QUEUE_HOST"))
# 消息队列虚拟机
# QUEUE_VHOST = str(config.get("QUEUE", "QUEUE_VHOST"))
# 消息队列端口
# QUEUE_PORT = int(config.get("QUEUE", "QUEUE_PORT"))
# 消息队列登录名
# QUEUE_USER = str(config.get("QUEUE", "QUEUE_USER"))
# 消息队列密码
# QUEUE_PASSWORD = str(config.get("QUEUE", "QUEUE_PASSWORD"))


'''
BASE_INTERFACE_URL  = config.get("BASE", "INTERFACE_URL")
#客户端列表
CLIENTS = []
CLIENTS_CLIENT_ID = config.get("CLIENTS", "CLIENT_ID").split(", ")
i=0
while(i<len(CLIENTS_CLIENT_ID)):
    CLIENTS.append({"id": CLIENTS_CLIENT_ID[i],
                    "md5key":config.get("CLIENTS", "MD5KEY_" + str(CLIENTS_CLIENT_ID[i])),
                    "deskey":config.get("CLIENTS", "DESKEY_" + str(CLIENTS_CLIENT_ID[i]))})
    i+=1
#print CLIENTS
'''
